﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Main.Master" AutoEventWireup="true"
    CodeBehind="RequireManage.aspx.cs" Inherits="ATW.MT.RequireManage.RequireManage" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cp01" runat="server">
    <div class="main_hd">
        <h2 style="padding: 0px 20px;">
            需求管理
        </h2>
        <div class="title_tab" id="topTab">
            <table style="width: 100%">
                <tr>
                    <td style="width: 50%">
                        需求标题：&nbsp;<input type="text" id="txtTitle" runat="server" />
                        发布人：&nbsp;<input type="text" style="margin-left: 2px;" id="txtName" runat="server" />
                    </td>
                    <td style="width: 30%">
                        需求类别：&nbsp;<asp:DropDownList runat="server" ID="ddlType" Style="width: 150px">
                            <asp:ListItem Text="全部" Value=""></asp:ListItem>
                            <asp:ListItem Text="物供" Value="1"></asp:ListItem>
                            <asp:ListItem Text="质量控制" Value="2"></asp:ListItem>
                            <asp:ListItem Text="研发" Value="3"></asp:ListItem>
                            <asp:ListItem Text="代理商" Value="4"></asp:ListItem>
                            <asp:ListItem Text="人员招聘" Value="5"></asp:ListItem>
                            <asp:ListItem Text="设备租赁和承包" Value="6"></asp:ListItem>
                            <asp:ListItem Text="合资工厂" Value="7"></asp:ListItem>
                            <asp:ListItem Text="全球销售和服务" Value="8"></asp:ListItem>
                            <asp:ListItem Text="销售" Value="9"></asp:ListItem>
                        </asp:DropDownList>
                        &nbsp;
                    </td>
                    <td rowspan="3" style="width: 20%">
                        &nbsp; &nbsp; &nbsp;
                        <asp:Button runat="server" ID="btnSearch" Text="搜索" class="MaintenanceButton" OnClick="btnSearch_Click"
                            Style="background: #d91913; outline: none; border: none; color: White; padding: 5px 20px;" />
                        &nbsp; &nbsp; &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        发布时间：&nbsp;<input id="txtPubStart" runat="server" class="Wdate" type="text" onfocus="var p_next=getDate('txtPubEnd');WdatePicker({skin:'whyGreen',maxDate:p_next||'%y-%M-%d'})" />&nbsp;
                        &nbsp;&nbsp; &nbsp;至&nbsp; &nbsp;&nbsp; &nbsp;
                        <input id="txtPubEnd" class="Wdate" runat="server" type="text" onfocus="var p_prv=getDate('txtPunStart'); WdatePicker({skin:'whyGreen',minDate:p_prv,maxDate:'%y-%M-%d'})" />
                        &nbsp;&nbsp;
                    </td>
                    <td>
                        审核状态：&nbsp;<asp:DropDownList runat="server" ID="ddlStatus" Width="150px">
                            <asp:ListItem Text="全部" Value=""></asp:ListItem>
                            <asp:ListItem Text="待审核" Value="0"></asp:ListItem>
                            <asp:ListItem Text="审核通过" Value="1"></asp:ListItem>
                            <asp:ListItem Text="删除" Value="2"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        截止时间：&nbsp;<input id="txtFinStart" runat="server" class="Wdate" type="text" onfocus="var c_next=getDate('txtFinEnd');WdatePicker({skin:'whyGreen',maxDate:c_next})" />&nbsp;
                        &nbsp;&nbsp; &nbsp;至&nbsp; &nbsp;&nbsp; &nbsp;
                        <input id="txtFinEnd" class="Wdate" type="text" runat="server" onfocus="var c_prv=getDate('txtFinStart');WdatePicker({skin:'whyGreen',minDate:c_prv})" />
                    </td>
                </tr>
            </table>
            <ul>
                <li>
                    <asp:Label runat="server" ID="lblError" ForeColor="Red" Font-Bold="true"></asp:Label></li>
            </ul>
        </div>
        <asp:Repeater ID="rpList" runat="server">
            <HeaderTemplate>
                <table width="95%" border="0" cellpadding="0" cellspacing="0" style="font-size: 14px"
                    class="queryResultTable">
                    <tr>
                        <th>
                            需求标题
                        </th>
                        <th>
                            需求类别
                        </th>
                        <th>
                            需求描述
                        </th>
                        <th>
                            发布人
                        </th>
                        <th>
                            发布时间
                        </th>
                        <th>
                            截止时间
                        </th>
                        <th>
                            竞价人数
                        </th>
                        <th>
                            状态
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <a class="tdititle" args='<%#"RequireDetail.aspx?did="+Eval("tdino").ToString()+"&r="+new Random().Next(1000).ToString() %>'>
                            <%#Eval("tdititle").ToString() %>
                        </a>
                    </td>
                    <td>
                        <%#Eval("tditype").ToString() %>
                    </td>
                    <td>
                        <%#subStr(Eval("tdiDesc").ToString(),15)%>
                    </td>
                    <td>
                        <%#Eval("tauName").ToString()%>
                    </td>
                    <td>
                        <%#Eval("tdiPublishTime").ToString() %>
                    </td>
                    <td>
                        <%#Eval("tdiCloseTime").ToString() %>
                    </td>
                    <td>
                        <asp:LinkButton runat="server" ID="lbnBidDetail" OnClick="lbnBidDetail_Click" Enabled='<%#Eval("num").ToString()=="0"?false:true %>'
                            CommandArgument='<%#Eval("tdiNO") %>'>
                            <asp:Label runat="server" ID="lblNum" Text='<%#Eval("num").ToString() %>'></asp:Label>
                        </asp:LinkButton>
                    </td>
                    <td>
                        <%#Eval("tdirowstatus").ToString() %>
                    </td>
                    <td>
                        <asp:LinkButton runat="server" ID="lbnAudit" OnClick="lbnAudit_Click" CommandArgument='<%#Eval("tdiid").ToString() %>'
                            Visible='<%#Eval("tdirowstatus").ToString()=="未审核"?true:false %>'>审核</asp:LinkButton>
                        <asp:LinkButton runat="server" ID="lbnDelete" OnClientClick="return confirm('您确定要删除该记录吗？')"
                            OnClick="lbnDelete_Click" CommandArgument='<%#Eval("tdiid").ToString() %>' Visible='<%#Eval("tdirowstatus").ToString()=="审核通过"?true:false %>'>
                            删除
                        </asp:LinkButton>
                        <asp:LinkButton runat="server" ID="lbnRecover" OnClick="lbnRecover_Click" CommandArgument='<%#Eval("tdiid").ToString() %>'
                            Visible='<%#Eval("tdirowstatus").ToString()=="已删除"?true:false %>'>
                            恢复
                        </asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <cc1:AspNetPager ID="AspNetPager1" Style="float: right" runat="server" PageSize="10"
            AlwaysShow="true" CssClass="paginator" CurrentPageButtonClass="cpb" FirstPageText="首页"
            PagingButtonSpacing="0" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"
            OnPageChanged="AspNetPager1_pageChanged">
        </cc1:AspNetPager>
    </div>
    <script type="text/javascript">
        function getDate(o) {
            var obj = $('[id$=' + o + ']').get(0);
            return $(obj).val()
        }
        $(function () {
            $('.tdititle').each(function (index, elt) {
                $(elt).click(function () {
                    var url = $(elt).attr('args');
                    linkView(url, "CommandDetail");
                })
            })
        } ())
    </script>
    <div id="divMsg" style="display: none;">
        <div class="tc_header">
            <h2>
                提示</h2>
            <a id="hideMsg">
                <img src="../images/chacha.png" width="13" height="13"></a>
        </div>
        <div class="tc_content">
            <div class="tanchu03" style="">
                <p id="msgContent">
                </p>
            </div>
        </div>
    </div>
</asp:Content>
